﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Chamberlain.BE;


namespace Chamberlain
{
    public partial class Chamberlain : Form
    {

        public Chamberlain()
        {
            InitializeComponent();
        }

        private void ShowNewForm(object sender, EventArgs e)
        {
            
        }

        private void OpenFile(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            openFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = openFileDialog.FileName;
            }
        }

        private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            saveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = saveFileDialog.FileName;
            }
        }

        private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
            Application.Exit();
        }

        private void CutToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

       
        private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            statusStrip.Visible = statusBarToolStripMenuItem.Checked;
        }

        private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.ArrangeIcons);
        }

        private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }

            
        }

        private void Chamberlain_Load(object sender, EventArgs e)
        {

        }

        private void Chamberlain_FormClosed(object sender, FormClosedEventArgs e)
        {
            Application.Exit();
        }

        private void toolStrip_ItemClicked(object sender, ToolStripItemClickedEventArgs e)
        {

        }
        private void BtnBuscar_MouseHover(object sender, EventArgs e)
        {
            BtnBuscar.Image = Properties.Resources.boton_busqueda2;
        }

        private void BtnBuscar_MouseLeave(object sender, EventArgs e)
        {
            BtnBuscar.Image = Properties.Resources.boton_busqueda;
        }

        private void BtnVentas_MouseHover(object sender, EventArgs e)
        {
            BtnVentas.Image = Properties.Resources.boton_ventas2;
        }

        private void BtnVentas_MouseLeave(object sender, EventArgs e)
        {
            BtnVentas.Image = Properties.Resources.boton_ventas;
        }

        private void BtnReportes_MouseHover(object sender, EventArgs e)
        {
            BtnReportes.Image = Properties.Resources.boton_reporte2;
        }

        private void BtnReportes_MouseLeave(object sender, EventArgs e)
        {
            BtnReportes.Image = Properties.Resources.boton_reporte;
        }

        private void BtnMatricula_MouseLeave(object sender, EventArgs e)
        {
            BtnMatricula.Image = Properties.Resources.boton_matricula;
        }

        private void BtnMatricula_MouseHover(object sender, EventArgs e)
        {
            BtnMatricula.Image = Properties.Resources.boton_matricula2;
        }

        private void BtnMatricula_Click(object sender, EventArgs e)
        {
            Alumno a= new Alumno();
            Matricula matricula = new Matricula();
            matricula.MdiParent = this;
            matricula.Text = "Chamberlain - Matricula";
            CMatricula matri = new CMatricula();
            matri.verifica_todos();
            MessageBox.Show("hola");


            matricula.Show();
            matricula.Location = new Point(matricula.Location.X, 140 + matricula.Location.Y);
            
        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }

        private void tileHorizontalToolStripMenuItem_Click_1(object sender, EventArgs e)
        {

        }

        private void closeAllToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }
        }

        private void BtnBuscar_Click(object sender, EventArgs e)
        {
            Busquedas buscar = new Busquedas();
            buscar.MdiParent = this;
            buscar.Text = "Chamberlain - Buscar alumnos";

            buscar.Show();
            buscar.Location = new Point(buscar.Location.X, 140 + buscar.Location.Y);
            
        }

        private void BtnVentas_Click(object sender, EventArgs e)
        {
            Ventas venta = new Ventas();
            venta.MdiParent = this;
            venta.Text = "Chamberlain - Venta de Productos";

            venta.Show();
            venta.Location = new Point(venta.Location.X, 140 + venta.Location.Y);
        }

        private void BtnReportes_Click(object sender, EventArgs e)
        {
            Reportes reporte = new Reportes();
            reporte.MdiParent = this;
            reporte.Text = "Chamberlain - Reportes";

            reporte.Show();
            reporte.Location = new Point(reporte.Location.X, 140 + reporte.Location.Y);
        }

        private void btnAlumno_MouseHover(object sender, EventArgs e)
        {
            btnAlumno.Image = Properties.Resources.boton_alumno2;
        }

        private void btnAlumno_MouseLeave(object sender, EventArgs e)
        {
            btnAlumno.Image = Properties.Resources.boton_alumno;
        }

        private void btnAlumno_Click(object sender, EventArgs e)
        {
            FrmAlumno falum = new FrmAlumno();
            falum.MdiParent = this;
            falum.Text = "Chamberlain - Alumnos";

            falum.Show();
            falum.Location = new Point(falum.Location.X, 140 + falum.Location.Y);
        }

        private void Chamberlain_Resize(object sender, EventArgs e)
        {
            int aux = 1000;
            if (Size.Width > aux)
                this.Size = new Size(aux, this.Size.Height);
        }

        private void veranoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Propiedades.Default.Temporada = "verano";
            MeVerano.Checked = true;
            MeInvierno.Checked = false;
        }


        private void MeInvierno_Click(object sender, EventArgs e)
        {
            Propiedades.Default.Temporada = "invierno";
            MeVerano.Checked = false;
            MeInvierno.Checked = true;
        }

        private void exitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void alumnoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FrmAlumno falum = new FrmAlumno();
            falum.MdiParent = this;
            falum.Text = "Chamberlain - Alumnos";

            falum.Show();
            falum.Location = new Point(falum.Location.X, 140 + falum.Location.Y);
        }

        private void matriculaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Alumno a = new Alumno();
            Matricula matricula = new Matricula();
            matricula.MdiParent = this;
            matricula.Text = "Chamberlain - Matricula";

            matricula.Show();
            matricula.Location = new Point(matricula.Location.X, 140 + matricula.Location.Y);
        }

        private void ventaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Ventas venta = new Ventas();
            venta.MdiParent = this;
            venta.Text = "Chamberlain - Venta de Productos";

            venta.Show();
            venta.Location = new Point(venta.Location.X, 140 + venta.Location.Y);
        }

        private void busquedaToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Reportes reporte = new Reportes();
            reporte.MdiParent = this;
            reporte.Text = "Chamberlain - Reportes";

            reporte.Show();
            reporte.Location = new Point(reporte.Location.X, 140 + reporte.Location.Y);
        }
     

    }
}
